<template>
  <div class="movie">
    <h1>我想看的电影名字必须是4-6的长度</h1>
    <ul>
      <li v-for="movie in myMovieList" :key="movie.tvId">
        {{ movie.albumName }}
      </li>
    </ul>
    <br />
    <h1>我想看的电影名字必须是我传递的长度</h1>
    <ul>
      <li v-for="movie in yourMovieList" :key="movie.tvId">
        {{ movie.albumName }}
      </li>
    </ul>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
// import {mapGetters} from "vuex"
export default {
    name: "MovieList",
    computed:{
        //计算我想看的电影不传参
        /* myMovieList(){
            return this.$store.getters.myMovieList
        } */

        ...mapGetters(["myMovieList"]),

        //计算我想看的电影传参 计算属性不能写参数 所以让getters返回函数用来传参
        // this.$store.getters.yourMovieList    =>    () => {}
        //因为这个计算属性的返回值要调用 所以不能简写
        yourMovieList(){
            return this.$store.getters.yourMovieList({start:3 , end:4})
        }

    },
}
</script>

<style scoped>
.movie{
    margin: 20px;
    background-color: aqua;
}
</style>